module diansha {
	export class paopao extends eui.Component implements eui.UIComponent {
		private num: eui.Label
		shuzi: shuzi
		startpoint: egret.Point = new egret.Point();
		endpoint: egret.Point = new egret.Point();
		time: number;
		errdetail: string;
		startcall: any;
		endcall: any
		public constructor(shuzi?: shuzi, startpoint?: egret.Point, endpoint?: egret.Point, time?: number, errdatail?: string, startcall?: any, endcall?: any) {
			super();
			this.shuzi = shuzi;
			this.time = time;
			this.startpoint = startpoint;
			this.endpoint = endpoint;
			this.errdetail = errdatail;
			this.startcall = startcall;
			this.endcall = endcall;
			this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onn, this)
		}
		protected partAdded(partName: string, instance: any): void {
			super.partAdded(partName, instance);
		}
		protected childrenCreated(): void {
			super.childrenCreated();



		}
		private onn() {

			this.x = this.startpoint.x
			this.y = this.startpoint.y
			this.startcall();
			egret.Tween.get(this).to({ x: this.endpoint.x, y: this.endpoint.y }, this.time).call(() => {
				this.parent.removeChild(this);
				this.endcall();

			})
			if (this.shuzi != undefined) {
				if (this.shuzi.danwei != "n") {
					this.num.text = this.shuzi.num + this.shuzi.danwei;
				} else {
					this.num.text = this.shuzi.num + ""
				}

			} else {
				this.num.text = this.errdetail;
			}

		}

	}
}